home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
HUGHES
/
FREENET1
/
!FreeNet
/
Docs
/
Firewalls
< prev
next >
Wrap
Text File
|
1996-02-18
|
4KB
|
108 lines
Firewalls using the FreeNet TCP/IP Stack
(C) Tom Hughes 1996
0. Copyright
The FreeNet module and application and the tools and documentation
that go with them are all copyright. They are however released as
freeware subject to certain terms and conditions. These are described
in the file named 'Licence' which should have accompanied this
document.
1. Overview
The firewall facilities in FreeNet allow you to control who can
access systems running on your machine or on other machines that
are the FreeNet system is acting as a router for.
They also allow a FreeNet machine to masquerade the connections
of other machines which are routed via it - that is to say it can
rewrite packet headers so that packets passed on to other systems
look like they came from the FreeNet system, and inbound packets
to the FreeNet system are (if necessary) passed on to the real
destination.
2. Enabling the Firewalls
The first step that you need to take to enable firewall and/or
masquerading is to set the 'ip firewall' option to on, either
in the configuration file or using netconf - see the 'Tuning'
file in this directory for more details.
If you wish to use masqeruading you will also need to set a
second option (ip masquerading) to on in the same way - note
that the firewall must also be enabled for masquerading to work.
3. Configuring the Firewalls
There are two firewalls available - the blocking firewall, which
acts on all packets sent/received by the system, and the forwarding
firewall which only acts on those packets being forwarded to other
systems.
There are also three possible actions that a firewall can take
with a packet - it can accept it, allowing it to pass; it can
reject it, throwing it away and sending an error message to the
originating system; or it can deny it, dropping it silently.
By default, both firewalls allow all packets to pass - this can
be changed by using the ipfw command, as follows:
ipfw policy <firewall> <action>
Where <firewall> is either 'blocking' or 'forwarding', and <action>
is one of 'accept', 'deny' or 'reject'.
This default policy can be overridden by adding specific rules
to the firewall for particular source/destination addresses:
ipfw add <firewall> <action> <type> [iface <interface>]
from <address>[/<bits>] [<port>[:<port>]]
to <address>[/<bits>] [<port>[:<port>]]
Where <type> is one of 'all', 'icmp', 'udp' or 'tcp'. Note that
a port number or port number range may only be given for udp and
tcp firewalls.
If an address is not qualified with a significant length in bits
then only that exact address will be matched. An address of 'default'
may be specified to match any address.
The firewall list is always scanned in the order that entries were
added until a match is found, so the most specific entries should
always be added first. If you make a mistake and need to start
again, you can remove all the entries as follows:
ipfw flush <firewall>
The list of entries which make up a firewall can be seen by using
the following command:
ipfw list <firewall>
Any packets which are blocked by either firewall will be logged
in the log file as warnings - set the 'log level' option to be
'info' or 'warning' to see them.
4. Configuring Masquerading
Masquerading relies on the forwarding firewall to work - entries
are created in the forwarding firewall with a special masquerading
flag set by using the following command:
ipfw add masquerade <type> [iface <interface>]
from <address>[/<bits>] [<port>[:<port>]]
to <address>[/<bits>] [<port>[:<port>]]
Any packet being forwarded by FreeNet which matches one of these
entries in the firewall will be masqueraded so that it appears
to come from the FreeNet system, and replies will be forwarded
back to the real originator of the packets.
Because masquerading uses the forwarding firewall, listing that
firewall will list the masquerade entries, and flushing it will
delete them.
$Id: Firewalls,v 1.1.2.2 1996/02/18 23:29:19 tom Exp $